<?php


namespace core\model;


use think\Model;

class SysMod extends Model {

    const STATUS_DISABLED = 0;  // 当前模组不可用
    const STATUS_ENABLED = 1;   // 当前模组已使用

    protected $table = 'sys_mod';

    public function getAllMods() {
        return $this->select();
    }

    public function getEnabledMods() {
        return $this->where('status', self::STATUS_ENABLED)->select();
    }

    public function getByName($name) {
        return $this->where('name', $name)->find();
    }

}
